package com.example.consumerone.services;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.common.base.Paging;
import com.example.common.model.ActivityArticle;
import com.example.common.model.condition.ActivityArticleCondition;
import com.example.consumerone.hystrix.ActivityArticleServiceHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@Service
@FeignClient(value = "provider", fallback = ActivityArticleServiceHystrix.class)
public interface ActivityArticleService {
    @RequestMapping(value = "/activityArticle/test")
    public String test();

    @RequestMapping(value = "/activityArticle/allActivityTypeList/{type}", method = RequestMethod.GET)
    public Map<String, Object> getActivityArticleList(@PathVariable("type") Integer type);

    @PostMapping("/activityArticle/list")
    public Paging<ActivityArticle> list(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestParam("type") Integer activityType);

    @GetMapping("/activityArticle/get")
    public Map<String, Object> getDetail(@RequestParam("aId") Integer aId,
                                         @RequestParam("userId") String userId,
                                         @RequestParam("authorId") String authorId);

    @PostMapping("/activityArticle/addArticleArticleParticipants")
    public Boolean addArticleArticleParticipants(
            @RequestParam("aId") Integer aId,
            @RequestParam("userId") String userId,
            @RequestParam("userName") String userName,
            @RequestParam("userAvatarUrl")String userAvatarUrl
    );

    @PostMapping("/activityArticle/reArticleArticleParticipants")
    public Boolean reArticleArticleParticipants(
            @RequestParam("aId") Integer aId,
            @RequestParam("userId") String userId
    );
}
